(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
or(true, y) → true
or(x, true) → true
or(false, false) → false
mem(x, nil) → false
mem(x, set(y)) → =(x, y)
mem(x, union(y, z)) → or(mem(x, y), mem(x, z))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
mem(x, union(y, z)) →+ or(mem(x, y), mem(x, z))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0].
The pumping substitution is [y / union(y, z)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
or(true, y) → true
or(x, true) → true
or(false, false) → false
mem(x, nil) → false
mem(x, set(y)) → ='(x, y)
mem(x, union(y, z)) → or(mem(x, y), mem(x, z))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
or(true, y) → true
or(x, true) → true
or(false, false) → false
mem(x, nil) → false
mem(x, set(y)) → ='(x, y)
mem(x, union(y, z)) → or(mem(x, y), mem(x, z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
mem
(8) Obligation:
TRS:
Rules:
or(
true,
y) →
trueor(
x,
true) →
trueor(
false,
false) →
falsemem(
x,
nil) →
falsemem(
x,
set(
y)) →
='(
x,
y)
mem(
x,
union(
y,
z)) →
or(
mem(
x,
y),
mem(
x,
z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
Generator Equations:
gen_nil:set:union5_0(0) ⇔ nil
gen_nil:set:union5_0(+(x, 1)) ⇔ union(nil, gen_nil:set:union5_0(x))
The following defined symbols remain to be analysed:
mem
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
mem(
hole_a2_0,
gen_nil:set:union5_0(
n7_0)) →
false, rt ∈ Ω(1 + n7
0)
Induction Base:
mem(hole_a2_0, gen_nil:set:union5_0(0)) →RΩ(1)
false
Induction Step:
mem(hole_a2_0, gen_nil:set:union5_0(+(n7_0, 1))) →RΩ(1)
or(mem(hole_a2_0, nil), mem(hole_a2_0, gen_nil:set:union5_0(n7_0))) →RΩ(1)
or(false, mem(hole_a2_0, gen_nil:set:union5_0(n7_0))) →IH
or(false, false) →RΩ(1)
false
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
or(
true,
y) →
trueor(
x,
true) →
trueor(
false,
false) →
falsemem(
x,
nil) →
falsemem(
x,
set(
y)) →
='(
x,
y)
mem(
x,
union(
y,
z)) →
or(
mem(
x,
y),
mem(
x,
z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
Lemmas:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
Generator Equations:
gen_nil:set:union5_0(0) ⇔ nil
gen_nil:set:union5_0(+(x, 1)) ⇔ union(nil, gen_nil:set:union5_0(x))
No more defined symbols left to analyse.
(12) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
(13) BOUNDS(n^1, INF)
(14) Obligation:
TRS:
Rules:
or(
true,
y) →
trueor(
x,
true) →
trueor(
false,
false) →
falsemem(
x,
nil) →
falsemem(
x,
set(
y)) →
='(
x,
y)
mem(
x,
union(
y,
z)) →
or(
mem(
x,
y),
mem(
x,
z))
Types:
or :: true:false:=' → true:false:=' → true:false:='
true :: true:false:='
false :: true:false:='
mem :: a → nil:set:union → true:false:='
nil :: nil:set:union
set :: b → nil:set:union
=' :: a → b → true:false:='
union :: nil:set:union → nil:set:union → nil:set:union
hole_true:false:='1_0 :: true:false:='
hole_a2_0 :: a
hole_nil:set:union3_0 :: nil:set:union
hole_b4_0 :: b
gen_nil:set:union5_0 :: Nat → nil:set:union
Lemmas:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
Generator Equations:
gen_nil:set:union5_0(0) ⇔ nil
gen_nil:set:union5_0(+(x, 1)) ⇔ union(nil, gen_nil:set:union5_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
mem(hole_a2_0, gen_nil:set:union5_0(n7_0)) → false, rt ∈ Ω(1 + n70)
(16) BOUNDS(n^1, INF)